package com.banyuan.HomeWork.集合类;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

//从控制台输入若干个单词（输入#结束）放入ArrayList中，将这些单词排序后（忽略大小写）打印出来。


public class Question1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<String> list = new ArrayList<>();
        System.out.println("输入字符串，输入#停止：");
        for (String s = sc.next(); !s.equals("#") ; s = sc.next()) {
            list.add(s);
        }
        list.sort(String::compareToIgnoreCase);
        System.out.println(list);

    }
}
